package com.lagou.service.impl;

import com.lagou.dao.ArticleDao;
import com.lagou.pojo.Article;
import com.lagou.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleDao articleDao;

    @Override
    public Page<Article> queryPage(int pageNum, int pageSize) {
        PageRequest pageRequest = PageRequest.of(pageNum,pageSize);
        Page<Article> all = articleDao.findAll(pageRequest);
        return all;

    }
}
